/*
 * LayoutManager.java  0.4.0 / Oct 24, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.swing.layouts;

import com.cute4j.swing.Component;
import com.cute4j.swing.Container;
import com.cute4j.swing.graphics.Dimension;

/**
 * Layout Manager.
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public interface LayoutManager {

  /**
   * Adds the specified component to the layout.
   *
   * @param component the component to be added
   * @param constraints the layout constraints
   */
  public void addLayoutComponent(Component component, Object constraints);

  /**
   * Removes the specified component from the layout.
   *
   * @param component the component to be removed
   */
  public void removeLayoutComponent(Component component);

  /**
   * Calculates the preferred size dimensions for the specified container.
   *
   * @param target the container to be laid out
   *
   * @return the preferred size of the specified container
   */
  public Dimension preferredLayoutSize(Container target);

  /**
   * Calculates the maximum size dimensions for the specified container.
   *
   * @param target the component to be laid out
   *
   * @return the maximum size of the specified container
   */
  public Dimension maximumLayoutSize(Container target);

  /**
   * Calculates the minimum size dimensions for the specified containers.
   *
   * @param target the component to be laid out
   *
   * @return the minimum size of the specified container
   */
  public Dimension minimumLayoutSize(Container target);

  /**
   * Lays out the specified container.
   *
   * @param target the container to be laid out
   */
  public void layoutContainer(Container target);

  /**
   * Invalidates the layout.
   *
   * @param target the container to be laid out
   */
  public void invalidateLayout(Container target);

}
